package com.lan.ai;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Swagger配置
 */
@Configuration
public class SwaggerConfig {

    @Bean
    public GroupedOpenApi otherApi() {
        String[] paths = {"/**"};
        String[] packagedToMatch = {"com.lan.ai"};
        return GroupedOpenApi.builder()
                .group("99")
                .displayName("ALL")
                .pathsToMatch(paths)
                .packagesToScan(packagedToMatch)
                .build();
    }

    @Bean
    public OpenAPI openApi() {
        Contact contact = new Contact();
        contact.setName("lan");

        return new OpenAPI().info(new Info()
                .title("lan API")
                .description("lan API")
                .contact(contact)
                .version("3.x")
        );
    }

}